import Vue from 'vue'
import Router from 'vue-router'

/*引入组件*/
import App from './App.vue'
import Home from './page/Home.vue'
import Login from './page/Login.vue'

Vue.config.debug = true;
Vue.use(Router);

new Vue({
    el: 'body',
    components: { App }
});

var router = new Router();

router.map({
    '/home': {
        component: Home
    },
    '/login': {
        component: Login
    }
});

router.beforeEach(function() {
    window.scrollTo(0, 0)
});

router.redirect({
    '*': '/home'
});

router.start(App, '#app');
